package gdut.stream.middle;

import java.util.Arrays;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;

public class FilterLamda {
    public static void main(String[] args) {
//        筛选出数组中大于2的值
        Integer[] arr = {1, 2, 3, 4, 5};
        Stream<Integer> integerStream = Arrays.stream(arr);
        integerStream
                .filter(integer -> integer > 2)
                .forEach(integer -> System.out.println(integer));
    }
}
